/**
 * 
 */
package org.meruvian.yama.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

import org.hibernate.annotations.GenericGenerator;


/**
 * @author vick
 *
 */

@Entity
@Table
@XmlRootElement(name = "person")
public class Person implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 203559588950186907L;

	@Id
    @GeneratedValue(generator="p")
    @GenericGenerator(name="p", strategy="uuid")
    @Column
    private String id;
	
	@Column
	private String firstName;
	
	@Column
	private String lastName;
	
	@Column 
	private Boolean gender;
	
	@Column
	private Date birthDate;
	
	@Column
	private String address;
 	
	@Column
	private String status;

	@OneToOne
	@JoinColumn(name="relation_id")
	private Person relation;
	
	@ManyToOne(fetch=FetchType.EAGER,cascade=CascadeType.ALL)
	@JoinColumn(name="parent_id")
	private Person parent;
	
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getFirstName() {
		return firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public String getLastName() {
		return lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public Boolean getGender() {
		return gender;
	}

	public void setGender(Boolean gender) {
		this.gender = gender;
	}

	public Date getBirthDate() {
		return birthDate;
	}

	public void setBirthDate(Date birthDate) {
		this.birthDate = birthDate;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public Person getRelation() {
		return relation;
	}

	public void setRelation(Person relation) {
		this.relation = relation;
	}

	public Person getParent() {
		return parent;
	}

	public void setParent(Person parent) {
		this.parent = parent;
	}
	
}
